package cn.smbms.service.role;

import cn.smbms.dao.provider.ProviderMapper;
import cn.smbms.dao.role.RoleMapper;
import cn.smbms.pojo.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service("roleService")
public class RoleServiceImpl implements RoleService {

    public RoleMapper getRoleMapper(){return roleMapper;}

    public void setRoleMapper(RoleMapper roleMapper) {
        this.roleMapper = roleMapper;
    }

    @Autowired
    private RoleMapper roleMapper;

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public int add(Role role) {
        return roleMapper.add(role);
    }

    @Override
    public List<Role> getroleName(Role role) {
        return roleMapper.getroleName(role);
    }

    @Override
    public int up(Role role) {
        return roleMapper.up(role);
    }

    @Override
    public int del(Role role) {
        return roleMapper.del(role);
    }
}
